package com.ty.day7;

/**
 * Created by IntelliJ IDEA.
 *
 * @author : txy
 * @create : 2023/11/30 15:30
 */
public class DeamonDemo01 {
    public static void main(String[] args) {
        Thread thread = new Thread(()->{
            try {
                Thread.sleep(1000);
                System.out.println("唱");
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        });
        thread.setDaemon(true);
        thread.start();
        Thread t2 = new Thread(()->{
            try {
                Thread.sleep(999);
                System.out.println("跳");
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        });
        t2.start();
        System.out.println("rap");
    }
}
